$(function () {
    let borrowid = localStorage.getItem('borrowid')
    $.ajax({
        url: 'http://139.9.177.51:3333/p2p/getborrowinfo',
        type: 'get',
        data: { borrowid },
        dataType: 'json',
        success: function (res) {
            // console.log(res);
            if (res.code == 200) {
                let data = res.data

                for (const key in data) {
             
                    if (key == 'repaytype') {
                        if (data[key] == 0) {
                            data[key] = '按月分期'
                        } else {
                            data[key] = '按月到期'
                        }
                    }
                    $(`#${key}`).html(data[key])
                }
            } else {
                alert('获取失败')
            }

        }
    })
})